﻿namespace FastFood.Controls.Complex
{
    using System;
    using System.Drawing;
    using System.Windows.Forms;
    using FastFood.Controls.PopupControl;

    public partial class NotificadorToolStripButton : ToolStripButton
    {
        #region Propiedas

        public Image ImagenSinNotificaciones { get; set; }
        public Image ImagenConNotificaciones { get; set; }
        public Form ParentForm { get; set; }
        
        #endregion

        #region Atributos

        Popup popup;
        BuzonMensajes buzon;

        #endregion

        public NotificadorToolStripButton()
        {
            InitializeComponent();
            buzon = new BuzonMensajes();
            popup = new Popup(buzon);
            popup.ShowingAnimation = PopupAnimations.RightToLeft;
            popup.Resizable = true;
        }

        protected override void OnClick(EventArgs e)
        {
            var location = this.ParentForm.Location;
            this.buzon.Buscar();
            popup.Show(location.X + ParentForm.Width, location.Y + ParentForm.Height);
        }
        
        protected override void OnPaint(PaintEventArgs pe)
        {
            base.OnPaint(pe);
        }
    }
}
